<div class="row">
  <div class="col-md-12">

    <div id="content_header">
      <h3>Register a new Discount Type</h3>
    </div>

    <div class="row">
      <div class="col-md-12 col-lg-6">
        <form name="countryForm" role="form" ng-submit="add()">

          <div class="row">
            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
              <div class="form-group" ng-class="{ 'has-error': errors.Prefix}">
                <label class="required" for="Prefix">Prefix</label>
                <input type="text" name="Prefix" class="form-control" id="" placeholder="Input field" ng-model="item.Prefix" required>
                <error-widget field="errors.Prefix"></error-widget>
              </div>
            </div>
            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
              <div class="form-group" ng-class="{ 'has-error': errors.Code}">
                <label class="required" for="Code">Code</label>
                <input type="text" name="Code" class="form-control" id="" placeholder="Input field" ng-model="item.Code" required>
                <error-widget field="errors.Code"></error-widget>
              </div>
            </div>
          </div>

          <div class="form-group">
            <label for="DiscountSourceType">Discount Source</label>
            <select name="DiscountSourceType" id="DiscountSourceType" class="form-control" ng-options="source.Id as source.Label for source in DiscountSourceTypes" ng-model="item.DiscountSourceType" required>
              <option value="" ng-hide="item.DiscountSourceType">Please Select a Discount Source</option>
            </select>
          </div>

          <div class="form-group" ng-class="{ 'has-error': errors.Name}">
            <label class="required" for="Name">Name</label>
            <input type="text" name="Name" class="form-control" id="" placeholder="Input field" ng-model="item.Name" required>
            <error-widget field="errors.Name"></error-widget>
          </div>

          <div class="form-group" ng-class="{ 'has-error': errors.MaximumPublished}">
            <label class="required" for="MaximumPublished">MaximumPublished</label>
            <input type="text" name="MaximumPublished" class="form-control" id="" placeholder="Input field" ng-model="item.MaximumPublished">
            <error-widget field="errors.MaximumPublished"></error-widget>
          </div>

          <div class="form-group" ng-class="{ 'has-error': errors.DefaultAmount}">
            <label for="DefaultAmount">DefaultAmount</label>
            <input type="text" name="DefaultAmount" class="form-control" id="" placeholder="Input field" ng-model="item.DefaultAmount">
            <error-widget field="errors.DefaultAmount"></error-widget>
          </div>

          <div class="form-group" ng-class="{ 'has-error': errors.DefaultPercentage}">
            <label for="DefaultPercentage">DefaultPercentage</label>
            <input type="text" name="DefaultPercentage" class="form-control" id="" placeholder="Input field" ng-model="item.DefaultPercentage">
            <error-widget field="errors.DefaultPercentage"></error-widget>
          </div>

          <div class="form-group" ng-class="{ 'has-error': errors.errors.DefaultValidFrom}">
            <label for="">Start Date</label>
            <div class="input-group" ng-click="openDatepicker($event, 0)">
              <input type="hidden" class="form-control" datepicker-popup="{{format}}" ng-model="item.DefaultValidFrom" is-open="datePicker.isOpen[0]" datepicker-options="dateOptions" close-text="Close" ng-disabled="true" />
              <input type="text" class="form-control" ng-disabled="true" ng-value="item.DefaultValidFrom | date: 'dd MMMM yyyy'">
              <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
            </div>
            <error-widget field="errors.errors.DefaultValidFrom"></error-widget>
          </div>

          <div class="form-group" ng-class="{ 'has-error': errors.errors.DefaultValidUntil}">
            <label for="">End Date</label>
            <div class="input-group" ng-click="openDatepicker($event, 1)">
              <input type="hidden" class="form-control" datepicker-popup="{{format}}" ng-model="item.DefaultValidUntil" is-open="datePicker.isOpen[1]" min-date="item.DefaultValidFrom" datepicker-options="dateOptions" close-text="Close" ng-disabled="true" />
              <input type="text" class="form-control" ng-disabled="true" ng-value="item.DefaultValidUntil | date: 'dd MMMM yyyy'">
              <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
            </div>
            <error-widget field="errors.errors.DefaultValidUntil"></error-widget>
          </div>

          <button type="submit" class="btn btn-primary" >Submit</button>
        </form>
      </div>
    </div>

  </div>
</div>